From a78ced9cf1a3fc274d679469ea38c03256dadd29 Mon Sep 17 00:00:00 2001 From: robertl Date: Sat, 1 Jul 2006 21:30:59 +0000 Subject: [PATCH] Add 'functions' file from Olaf. --- functions | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 functions diff --git a/functions b/functions new file mode 100644 index 000000000..a0fb09362 --- /dev/null +++ b/functions @@ -0,0 +1,41 @@ +function trim_filelist() +{ + sort | + uniq | # remove duplicate lines + sed 's/^[ \t]*//;s/[ \t]*$//' | # remove leading and trailing whitespaces + sed '/^$/d' # drop empty lines +} + +function check_filelist() # check presence of all files +{ + while read f; do + [ -e "$f" ] && continue + echo missing: "$f"; exit 1 + done + exit 0 +} + +function ask_mrproper() +{ + echo "" + echo "--------------------------------------------------" + echo "!!! WARNING !!! WARNING !!! WARNING !!!WARNING !!!" + echo "--------------------------------------------------" + echo "All files they are not part of the CVS source tree" + echo " and they not registered in .filelist-devel" + echo " will be killed." + echo "" + echo -n "Please type yyeess if you are know what you do: " + read answer + test "$answer" != "yyeess" && exit 1 + exit 0 +} + +function ask() # $1=Question $2=Answer for TRUE +{ + echo "" + echo -n "$1 : " + read answer + test "$answer" != "$2" && exit 1 + exit 0 +} -- 2.30.2